<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
	<model>
		<instance>
			<Query name="MailFormSubmissions" storedProcedure="spMailFormSubmissions" excelXsl="" formTargetURL="self" filter="All">
				<param name="startDate" type="datetime" value=""/>
				<param name="endDate" type="datetime" value=""/>
				<param name="formType" type="string"  value=""/>
			</Query>
		</instance>
		<submission id="MailFormSubmissions" action="" method="post" event="return form_check(this)"/>
		<bind nodeset="Query">
			<bind id="startDate" nodeset="param[@name='startDate']/@value" required="true()" type="string"/>
			<bind id="endDate" nodeset="param[@name='endDate']/@value" required="false()" type="string"/>
			<bind id="formType" nodeset="param[@name='formType']/@value" required="false()" type="string"/>
			<bind id="filter" nodeset="@filter" required="false()" type="string"/>
			<bind id="formTargetUrl" nodeset="@formTargetURL" required="false()" type="string"/>
		</bind>
	</model>
	<group ref="EditContent" class="inline">
		<label>Mail Form Submissions Report</label>
		<input bind="startDate" class="calendar">
			<label>Start Date</label>
		</input>
		<input bind="endDate" class="calendar">
			<label>End Date</label>
		</input>
		<select1 bind="formType" class="ewQuery" query="execute spMailTypeOptions">
			<label>Form Type</label>
		</select1>
	</group>
	<group ref="EditContent" class="inline">
        <!--select1 bind="formTargetUrl" class="updateTarget" appearance="minimal">
			<label>Output</label>
			<item>
				<label>On Screen</label>
				<value>self</value>
			</item>
			<item>
				<label>CSV Download</label>
				<value>/ewcommon/tools/export.ashx?ewcmd=Reports&amp;ewCmd2=Mail-Form-Submissions&amp;reportXsl=Mail-Form-Submissions&amp;format=csv</value>
			</item>
		</select1>
		<select1 bind="filter" class="updateTarget" appearance="full">
			<label>Filter</label>
			<item>
				<label>All Results</label>
				<value>All</value>
			</item>
			<item>
				<label>Since Last Download</label>
				<value>SinceLast</value>
			</item>
		</select1>
		<div>
			<script type="text/javascript">
				$("#formTargetUrl").change(function() {
				//alert($("#formTargetUrl :selected").val());
				var action = $(this).val() == "people" ? "user" : "content";
				if($("#formTargetUrl :selected").val()!='self') {
				$("#MailFormSubmissions").attr("action", $("#formTargetUrl :selected").val());
				};
				});
			</script>
		</div>
		<select1 ref="xml" class="updateTarget" appearance="full">
			<label>xml</label>
			<item>
				<label>on</label>
				<value>on</value>
			</item>
			<item>
				<label>off</label>
				<value></value>
			</item>
		</select1-->
		<submit submission="" ref="ewSubmit" class="principle">
			<label>Get Report</label>
		</submit>
	</group>
</Content>